<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <bean id="vtabroot" class="com.taobao.tddl.interact.rule.VirtualTableRoot" init-method="init">
        <property name="dbType" value="MYSQL"/>
        <property name="defaultDbIndex" value="${appProperty.tddl.group}"/>
        <property name="tableRules">
            <map>
        <#if tableMetaList?exists>
            <#list tableMetaList as tableMeta>
                <entry key="${tableMeta.name}" value-ref="${tableMeta.name}_bean"/>
            </#list>
        </#if>
            </map>
        </property>
    </bean>

<#if tableMetaList?exists>
<#list tableMetaList as tableMeta>
    <bean id="${tableMeta.name}_bean" class="com.taobao.tddl.interact.rule.TableRule" init-method="init">
        <property name="dbNamePattern" value="${appProperty.tddl.group}"/>
        <property name="tbNamePattern" value="${tableMeta.name}"></property>
    </bean>

</#list>
</#if>
</beans>
